//
// Created by 74269 on 2024/8/15.
//

#pragma once

#include <vector>

//#define ACTION_INSTRUCT(K, V) do{ std::vector<uint8_t> K(V) }while(0)



#define RESET            {0x55, 0x00, 0xFF, 0x00, 0x00, 0xAA, 0xAA}
#define TRAY_OUT         {0x55, 0x01, 0xFE, 0x01, 0x00, 0xAB, 0xAA}
#define TRAY_IN          {0x55, 0x02, 0xFD, 0x02, 0x00, 0xA8, 0xAA}
#define TRAY_TO_SCANNER  {0x55, 0x1B, 0xE4, 0x1B, 0x00, 0xB1, 0xAA}
#define TRAY_STATE       {0x55, 0x06, 0xF9, 0x03, 0x00, 0xA9, 0xAA}
#define TRAY_TO_HGB      {0x55, 0x04, 0xFB, 0x04, 0x00, 0xAE, 0xAA}
#define TRAY_POSITION    {0x55, 0x0B, 0xF4, 0x0B, 0x00, 0xA1, 0xAA}
#define DETECT_HGB       {0x55, 0x05, 0xFA, 0x05, 0x00, 0xAF, 0xAA}
#define LED_OPEN         {0x55, 0x06, 0xF9, 0x06, 0x01, 0x01, 0xAC, 0xAA}
#define LED_CLOSE        {0x55, 0x06, 0xF9, 0x06, 0x01, 0x00, 0xAD, 0xAA}
#define TRIAXIAL_RESET   {0x55, 0x1A, 0xE5, 0x1A, 0x00, 0xB0, 0xAA}
#define RESTORE_PROFILE  {0x55, 0x1F, 0xE0, 0x1F, 0x00, 0xB5, 0xAA}
#define MOVE_SCANNING    {0x55, 0x24, 0xDB, 0x24, 0x00, 0x8E, 0xAA}


//#define ACTION_INSTRUCT_TEMPLATE(NAME, INSTRUCT, DATA) \
//    do{                                           \
//        ACTION_INSTRUCT_TYPE NAME;                     \
//        NAME.push_back(0x55);                          \
//        NAME.push_back(0x00);                          \
//        NAME.push_back(0xFF);                          \
//        NAME.push_back(INSTRUCT);                      \
//        NAME.push_back((DATA.size())&0xFF);            \
//        NAME.insert(NAME.end(), DATA.begin(), DATA.end());                                             \
//        , 0x00, 0xFF, INSTRUCT, (INPUT.size())&0xFF, \
//    }while(0)